<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>五子棋游戏</title>
    <link href="./css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
            padding-top: 20px;
            transition: opacity 0.3s;
        }
        .game-container {
            max-width: 1000px;
            margin: 0 auto;
            padding: 0 15px;
        }
        .board-container {
            position: relative;
            width: 100%;
            padding-top: 100%;
            background-color: #e6c88c;
            border: 2px solid #8b4513;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.2);
        }
        #game-board {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            touch-action: none;
        }
        .game-info {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            height: 100%;
        }
        #game-status {
            font-weight: bold;
        }
        @media (max-width: 767.98px) {
            .game-info {
                margin-top: 20px;
            }
        }
        #gameOverModal .modal-content {
            border: none;
            box-shadow: 0 0 20px rgba(0,0,0,0.3);
        }
        #gameOverModal .modal-header {
            border-bottom: none;
            background-color: #f8f9fa;
            border-radius: .3rem .3rem 0 0;
        }
        #gameOverModal .modal-footer {
            border-top: none;
            justify-content: center;
        }
    </style>
</head>
<body>
    <div class="container game-container">
        <div class="d-flex justify-content-between align-items-center mb-4">
            <h2 id="game-title">五子棋对战</h2>
            <button id="back-btn" class="btn btn-outline-secondary">返回大厅</button>
        </div>
        
        <div class="row gx-3">
            <div class="col-lg-8 col-md-7 mb-4 mb-md-0">
                <div class="board-container">
                    <canvas id="game-board"></canvas>
                </div>
            </div>
            
            <div class="col-lg-4 col-md-5">
                <div class="game-info">
                    <h4 class="mb-3">游戏信息</h4>
                    <div id="game-status" class="alert alert-info mb-3">黑方回合</div>
                    
                    <div class="mb-3">
                        <h5>模式: <span id="game-mode">人机对战</span></h5>
                        <div id="ai-info" class="d-none">
                            <p>AI难度: <span id="ai-level">中等</span></p>
                            <p>AI执: <span id="ai-color">黑棋</span></p>
                        </div>
                        <div id="online-info" class="d-none">
                            <p>房间号: <span id="room-id">-</span></p>
                        </div>
                    </div>
                    
                    <div class="mb-4">
                        <h5>当前玩家</h5>
                        <p>黑棋: <span id="black-player">你</span></p>
                        <p>白棋: <span id="white-player">AI</span></p>
                    </div>
                    
                    <div class="d-flex">
                        <button id="undo-btn" class="btn btn-secondary btn-sm me-2">悔棋</button>
                        <button id="restart-btn" class="btn btn-warning btn-sm me-2">重新开始</button>
                        <button id="surrender-btn" class="btn btn-danger btn-sm">认输</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 游戏结束模态框 -->
    <div class="modal fade" id="gameOverModal" tabindex="-1" data-bs-backdrop="static">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="gameOverTitle">游戏结束</h5>
                </div>
                <div class="modal-body" id="gameOverMessage">
                    比赛结果信息将显示在这里
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="playAgainBtn">再玩一局</button>
                    <button type="button" class="btn btn-success" id="returnToLobbyBtn">返回大厅</button>
                </div>
            </div>
        </div>
    </div>

    <script src="./js/bootstrap/bootstrap.bundle.min.js"></script>
    <script src="./js/game.js"></script>
</body>
</html>